package com.migration.model.newdb;

import jakarta.persistence.*;
import lombok.Data;
import java.math.BigDecimal;
import java.io.Serializable;

/**
 * 防护措施表 实体类
 * 表名：risk_protection
 * 自动生成的实体类
 */
@Data
@Entity
@Table(name = "risk_protection")
public class RiskProtection implements Serializable {

    private static final long serialVersionUID = 1L;
    
    /**
     * ID
     * 主键
     */
    @Id
    @Column(name = "id", nullable = false)
    private Long id;
    
    /**
     * 租户ID
     */
    @Column(name = "tenant_id", nullable = false)
    private Long tenantId;
    
    /**
     * 部门ID
     */
    @Column(name = "department_id", nullable = false)
    private Long departmentId;
    
    /**
     * 防护措施位号
     */
    @Column(name = "tag_number", length = 100)
    private String tagNumber;
    
    /**
     * 防护措施描述
     */
    @Column(name = "protection_desc", nullable = false, length = 255)
    private String protectionDesc;
    
    /**
     * PFD 0.001 ~ 1
     */
    @Column(name = "pfd", nullable = false)
    private BigDecimal pfd;
    
    /**
     * 所属设备ID（关联设备表的外键）
     */
    @Column(name = "device_id")
    private Long deviceId;
    
    /**
     * 防护类型（对应防护措施枚举类型）
     */
    @Column(name = "measure_type", nullable = false)
    private Integer measureType;
    
    /**
     * 主要参数
     */
    @Column(name = "main_parameters", length = 255)
    private String mainParameters;
    
    /**
     * 主要功能
     */
    @Column(name = "main_function", length = 255)
    private String mainFunction;
    
    /**
     * 回路SIL等级
     */
    @Column(name = "sil_level", length = 10)
    private String silLevel;
    
    /**
     * 设定值
     */
    @Column(name = "set_value", length = 50)
    private String setValue;
    
    /**
     * 传感器位号
     */
    @Column(name = "sensor_id", length = 255)
    private String sensorId;
    
    /**
     * 传感器冗余度
     */
    @Column(name = "sensor_redundancy", length = 50)
    private String sensorRedundancy;
    
    /**
     * 执行器位号
     */
    @Column(name = "actuator_id", length = 255)
    private String actuatorId;
    
    /**
     * 执行器冗余度
     */
    @Column(name = "actuator_redundancy", length = 50)
    private String actuatorRedundancy;
    
    /**
     * 处置指导
     */
    @Column(name = "instruction", length = 255)
    private String instruction;
    
    /**
     * 单位
     */
    @Column(name = "unit", length = 50)
    private String unit;
    
    /**
     * 设定压力
     */
    @Column(name = "set_pressure", length = 50)
    private String setPressure;
    
    /**
     * 设计工况
     */
    @Column(name = "design_condition", length = 100)
    private String designCondition;
    
    /**
     * 泄放量
     */
    @Column(name = "relief_capacity", length = 50)
    private String reliefCapacity;
    
    /**
     * 泄放口径
     */
    @Column(name = "relief_diameter", length = 50)
    private String reliefDiameter;
    
    /**
     * 物料名称
     */
    @Column(name = "material_name", length = 100)
    private String materialName;
    
    /**
     * 物料状态
     */
    @Column(name = "material_state", length = 50)
    private String materialState;
    
    /**
     * 容量
     */
    @Column(name = "capacity", length = 50)
    private String capacity;
    
    /**
     * 预警类型：0-全部 1-高限预警 2-低限预警
     * 默认值: 0
     */
    @Column(name = "alert_type")
    private Byte alertType;
    
    /**
     * 高限
     */
    @Column(name = "high_limit")
    private BigDecimal highLimit;
    
    /**
     * 高高限
     */
    @Column(name = "high_high_limit")
    private BigDecimal highHighLimit;
    
    /**
     * 高高高限
     */
    @Column(name = "high_high_high_limit")
    private BigDecimal highHighHighLimit;
    
    /**
     * 低限
     */
    @Column(name = "low_limit")
    private BigDecimal lowLimit;
    
    /**
     * 低低限
     */
    @Column(name = "low_low_limit")
    private BigDecimal lowLowLimit;
    
    /**
     * 低低低限
     */
    @Column(name = "low_low_low_limit")
    private BigDecimal lowLowLowLimit;
    
    /**
     * 是否关联了事故链0：否，1：是
     */
    @Column(name = "accident_chains_status")
    private Boolean accidentChainsStatus;
    
    /**
     * 事故链数量
     * 默认值: 0
     */
    @Column(name = "accident_chains_num")
    private Integer accidentChainsNum;
    
    /**
     * 是否关联了报警位号0：否，1：是
     * 默认值: 0
     */
    @Column(name = "alarm_tag_status")
    private Boolean alarmTagStatus;
    
    /**
     * 排序号
     * 默认值: 0
     */
    @Column(name = "sort_num")
    private Integer sortNum;
    
    /**
     * 创建时间yyyy-MM-dd HH:mm:ss
     */
    @Column(name = "create_time", length = 20)
    private String createTime;
    
    /**
     * 创建人
     */
    @Column(name = "create_by")
    private Long createBy;
    
    /**
     * 修改时间yyyy-MM-dd HH:mm:ss
     */
    @Column(name = "update_time", length = 20)
    private String updateTime;
    
    /**
     * 修改人
     */
    @Column(name = "update_by")
    private Long updateBy;
    
    /**
     * 是否删除（0：正常，1：删除）
     * 默认值: 0
     */
    @Column(name = "is_del")
    private Byte isDel;
    
    @Override
    public String toString() {
        return "RiskProtection{" +
            "id=" + id +
            ", tenantId=" + tenantId +
            ", departmentId=" + departmentId +
            ", tagNumber=" + tagNumber +
            ", protectionDesc=" + protectionDesc +
            ", pfd=" + pfd +
            ", deviceId=" + deviceId +
            ", measureType=" + measureType +
            ", mainParameters=" + mainParameters +
            ", mainFunction=" + mainFunction +
            ", silLevel=" + silLevel +
            ", setValue=" + setValue +
            ", sensorId=" + sensorId +
            ", sensorRedundancy=" + sensorRedundancy +
            ", actuatorId=" + actuatorId +
            ", actuatorRedundancy=" + actuatorRedundancy +
            ", instruction=" + instruction +
            ", unit=" + unit +
            ", setPressure=" + setPressure +
            ", designCondition=" + designCondition +
            ", reliefCapacity=" + reliefCapacity +
            ", reliefDiameter=" + reliefDiameter +
            ", materialName=" + materialName +
            ", materialState=" + materialState +
            ", capacity=" + capacity +
            ", alertType=" + alertType +
            ", highLimit=" + highLimit +
            ", highHighLimit=" + highHighLimit +
            ", highHighHighLimit=" + highHighHighLimit +
            ", lowLimit=" + lowLimit +
            ", lowLowLimit=" + lowLowLimit +
            ", lowLowLowLimit=" + lowLowLowLimit +
            ", accidentChainsStatus=" + accidentChainsStatus +
            ", accidentChainsNum=" + accidentChainsNum +
            ", alarmTagStatus=" + alarmTagStatus +
            ", sortNum=" + sortNum +
            ", createTime=" + createTime +
            ", createBy=" + createBy +
            ", updateTime=" + updateTime +
            ", updateBy=" + updateBy +
            ", isDel=" + isDel +
        '}';
    }
} 